const state =  {
    username:'tom',
    age:20
}

const mutations = {
    setUsername(state){
        state.username = 'jack'
    }
}

const actions = {
    loadUsername(context){
        context.commit('setUsername')
    }
}

export default {
    state,
    mutations,
    actions
}